/*
 * @Author: HZK
 * @Date: 2020-09-08 14:08:50
 * @LastEditTime: 2020-09-08 14:10:13
 * @LastEditors: hanfengmi
 * @Description: 头部
 */
import React, { PureComponent } from 'react'
import { connect } from 'dva'
import styles from './index.less'
import Img from '@/components/Img'
import MenuList from '@/components/MenuList'
import LoginInfo from '@/components/LoginInfo'

import Logo from '@/assets/logo.png'
import { getUrlKey } from '@/utils/index'
 
@connect(({ user }) => ({
  user
}))
class Index extends PureComponent {
  render() {
    const {user: { info }} = this.props

    const list = [ //todo 使用动态数据
      { url: `/assets2/new-fwq/dist/#/home?ciId=${getUrlKey('ciId')}`, type: 'url', name: '社区' },
      { url: '/case', type: 'link', name: '客户案例' },
      { url: `/up_service/index.php?r=index/index&ciId=${getUrlKey('ciId')}`, type: 'url', name: '服务后台' }
    ]

    return (
      <div className={`${styles.Header}`}>
        <Img imgClass={styles.Logo} src={Logo} />
        <MenuList list={ list } /> 
        <LoginInfo info={ info } />
      </div> 
    )
  }
}

export default Index